<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>fs.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">fs.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_fs_fs.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/fs/fs.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/fs/fs.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.fs.blobToString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">blobToString<span class="args">(<span class="arg">blob</span>,&nbsp;<span class="arg">opt_encoding</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use <code> goog.fs.FileReader.readAsText</code> instead.</span>
       Converts a Blob or a File into a string. This should only be used when the
blob is known to be small.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <span>!</span><span class="type">Blob</span>
        <div class="entryOverview">The blob to convert.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_encoding</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The name of the encoding to use.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>&nbsp;
            The deferred string. If an error occurrs, the
    errback is called with a <code> goog.fs.Error</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line194">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.createObjectUrl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">createObjectUrl<span class="args">(<span class="arg">blob</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Creates a blob URL for a blob object.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <span>!</span><span class="type">Blob</span>
        <div class="entryOverview">The object for which to create the URL.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The URL for the object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line114">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.getBlob"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">getBlob<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">Blob</span>
      </div>


     <div class="entryOverview">
       Concatenates one or more values together and converts them to a Blob.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...(string</span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type">Blob</span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type">ArrayBuffer</span>)
        <div class="entryOverview">The values that will make up
    the resulting blob.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">Blob</span>&nbsp;
            The blob.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line169">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.getPersistent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">getPersistent<span class="args">(<span class="arg">size</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>
      </div>


     <div class="entryOverview">
       Returns a persistent FileSystem object. A persistent filesystem will never be
deleted without the user's or application's authorization.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">size</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The size requested for the filesystem, in bytes.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>&nbsp;
            The deferred <code> goog.fs.FileSystem</code>. If an
    error occurs, the errback is called with a <code> goog.fs.Error</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line103">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.getTemporary"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">getTemporary<span class="args">(<span class="arg">size</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>
      </div>


     <div class="entryOverview">
       Returns a temporary FileSystem object. A temporary filesystem may be deleted
by the user agent at its discretion.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">size</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The size requested for the filesystem, in bytes.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>&nbsp;
            The deferred <code> goog.fs.FileSystem</code>. If an
    error occurs, the errback is called with a <code> goog.fs.Error</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line90">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.fs.getUrlObject_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">getUrlObject_<span class="args">()</span>
        </span>
        &#8658; <span class="type">goog.fs.UrlObject_</span>
      </div>


     <div class="entryOverview">
       Get the object that has the createObjectURL and revokeObjectURL functions for
this browser.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">goog.fs.UrlObject_</span>&nbsp;
            The object for this browser.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line143">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.fs.get_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">get_<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">size</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>
      </div>


     <div class="entryOverview">
       Get a wrapped FileSystem object.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type">goog.fs.FileSystemType_</span>
        <div class="entryOverview">The type of the filesystem to get.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">size</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The size requested for the filesystem, in bytes.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_async_Deferred.html">goog.async.Deferred</a></span>&nbsp;
            The deferred <code> goog.fs.FileSystem</code>. If an
    error occurs, the errback is called with a <code> goog.fs.Error</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line45">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.revokeObjectUrl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">revokeObjectUrl<span class="args">(<span class="arg">url</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Revokes a URL created by <code> goog.fs.createObjectUrl</code>.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">url</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The URL to revoke.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line124">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.fs.sliceBlob"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.fs.</span><span class="entryName">sliceBlob<span class="args">(<span class="arg">blob</span>,&nbsp;<span class="arg">start</span>,&nbsp;<span class="arg">opt_end</span>)</span>
        </span>
        &#8658; <span class="type">Blob</span>
      </div>


     <div class="entryOverview">
       Slices the blob. The returned blob contains data from the start byte
(inclusive) till the end byte (exclusive). Negative indices can be used
to count bytes from the end of the blob (-1 == blob.size - 1). Indices
are always clamped to blob range. If end is omitted, all the data till
the end of the blob is taken.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">blob</span>
        : <span>!</span><span class="type">Blob</span>
        <div class="entryOverview">The blob to be sliced.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">start</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Index of the starting byte.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_end</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Index of the ending byte.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">Blob</span>&nbsp;
            The blob slice or null if not supported.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_fs_fs.js.source.html#line211">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory fs</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/fs/fs.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
